package com.ny20231079080.service.impl;

import com.ny20231079080.dao.StudentDao;
import com.ny20231079080.dao.Impl.StudentDaolmpl;
import com.ny20231079080.entity.Student;
import com.ny20231079080.service.StudentService;

import java.sql.SQLException;

public class StudentServicelmpl implements StudentService {
    private StudentDao studentDao=new StudentDaolmpl();
    @Override
    public Student login(String name, String password) throws Exception {
        return studentDao.login(name,password);
    }
    @Override
    public int insertStudent(Student student) throws SQLException, ClassNotFoundException {
        return studentDao.insertStudent(student);
    }

    @Override
    public int updateStudent(Student student) throws SQLException, ClassNotFoundException {
        return studentDao.update(student);
    }

    @Override
    public Student findById(int studentId) throws SQLException, ClassNotFoundException {
        return studentDao.findById(studentId);
    }
}
